{% extends 'oracle/base.html' %}
{% load oracle %}

{% block content %}
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-lg-12">
                <div class="ibox ">
                    <div class="ibox-title">
                        <h5>url列表</h5>
                        <div class="ibox-tools">
                            {% if request|has_permission:'oracle:deploy_url_add' %}
                                <a class="btn btn-primary btn-rounded btn-sm"
                                   href="{% url 'oracle:deploy_url_add' %}" id="save_user_roles">
                                    <i class="fa fa-plus"></i> 新建url
                                </a>
                            {% endif %}
                            <a class="btn btn-info btn-circle collapse-link" type="button"
                               style="color: white!important;">
                                <i class="fa fa-chevron-up"></i>
                            </a>
                        </div>
                    </div>
                    <div class="ibox-content">
                        <table class="table table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>#</th>
                                <th>名称</th>
                                <th>url</th>
                                <th>类型</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for row in data.settings_url_list %}
                                <tr>
                                    <td>{{ forloop.counter }}</td>
                                    <td>{{ row.title }}</td>
                                    <td>{{ row.url }}</td>
                                    <td>{{ row.type }}</td>
                                    <td>
                                        {% if request|has_permission:"oracle:deploy_url_edit" %}
                                            <a type="button" class="btn btn-outline btn-info"
                                               href="{% url 'oracle:deploy_url_edit' key=row.key %}">
                                                <i class="fa fa-edit"></i> 修改
                                            </a>
                                        {% endif %}
                                        {% if request|has_permission:"oracle:deploy_url_del" %}
                                            <a type="button" class="btn btn-outline btn-danger"
                                               href="{% url 'oracle:deploy_url_del' key=row.key %}">
                                                <i class="fa fa-trash-o"></i> 删除
                                            </a>
                                        {% endif %}
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}